// Lang_11 [dot operator].nova // The application class. class DotOperatorApp { // Application class's "main" function. public static void main( String[] args ) { // Create an instance of class "A". A a = new A( ); // Call the "B" class methods. a.getB( ).method1( ); B.method2( ); // Output the "B" class attributes. Stream.writeLine( Integer.toString( a.getB( ).i ) ); Stream.writeLine( Integer.toString( B.s ) ); // Assign to the "B" class attributes. a.getB( ).i = 123; B.s = 321; // Output the "B" class attributes. Stream.writeLine( Integer.toString( a.getB( ).i ) ); Stream.writeLine( Integer.toString( B.s ) ); } } class A { // Instance attribute. public B b; // Constructor. public A( ) { Stream.writeLine( "A.A( ) called." ); // Create an instance of class "B". b = new B( ); } // Return the "b" instance attribute. public B getB( ) { return b; } } class B { // Instance attribute. public int i; // Static attribute. public static int s; // Constructor. public B( ) { Stream.writeLine( "B.B( ) called." ); // Initialize the attributes to zero. i = 0; s = 0; } // Instance method. public void method1( ) { Stream.writeLine( "B.method1( ) called." ); } // Static method. public static void method2( ) { Stream.writeLine( "B.method2( ) called." ); } }